package com.shanwen.shopping.pop;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import com.shanwen.shopping.R;
import com.shanwen.shopping.utils.SizeUtils;


/**
 * Created by zyyoona7 on 2017/8/4.
 */

public class ComplexPopup extends BaseCustomPopup {
    private static final String TAG = "ComplexPopup";

    private TextView tvCleanCart;
    private ListView lvDialog;

    protected ComplexPopup(Context context) {
        super(context);
    }


    @Override
    protected void initAttributes() {
        WindowManager wm = (WindowManager) getContext()
                .getSystemService(Context.WINDOW_SERVICE);

        int height = wm.getDefaultDisplay().getHeight();
        setContentView(R.layout.dialog_layout, ViewGroup.LayoutParams.MATCH_PARENT, height/3);
        setFocusAndOutsideEnable(false)
                .setBackgroundDimEnable(true)
                .setDimValue(0.5f);

    }

    @Override
    protected void initViews(View view) {
        tvCleanCart = getView(R.id.tvCleanCart);
        lvDialog = getView(R.id.lvDialog);

        tvCleanCart.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }
}
